hash=`md5sum ./build/asset-manifest.json |cut -d ' ' -f1`
echo '{"hash":"'$hash'"}'>./build/hash.json
# sed -i '' "s/{__hash__}/<script>window._hash=_hash||'$hash'<\/script>/g" ./build/test.html

if [ "$(uname)" = "Darwin" ]; then
    sed -i '' "s/{__hash__}/$hash/g" ./build/index.html
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then 
    sed -i "s/{__hash__}/$hash/g" ./build/index.html
elif [ "$(expr substr $(uname -s) 1 10)" = "MINGW32_NT" ]; then
    sed -i "s/{__hash__}/$hash/g" ./build/index.html
fi